package com.xiaofeng.pochi.service.impl;

import com.xiaofeng.pochi.common.Page;
import com.xiaofeng.pochi.enums.OrderStateEnum;
import com.xiaofeng.pochi.mapper.ShopOrderPayMapper;
import com.xiaofeng.pochi.pojo.ShopOrderPay;
import com.xiaofeng.pochi.pojo.vo.OrderPointVo;
import com.xiaofeng.pochi.service.ShopOrderPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/09/17/23:54
 * @Description:
 */
@Service
public class ShopOrderPayServiceImpl implements ShopOrderPayService {
    @Autowired
    private ShopOrderPayMapper shopOrderPayMapper;

    @Override
    public Page<ShopOrderPay> getByPage(Page<ShopOrderPay> page) {
        List<ShopOrderPay> list = shopOrderPayMapper.getByPage(page);
        Integer count = shopOrderPayMapper.getCountByPage(page);
        page.setList(list);
        page.setTotalCount(count);
        return page;
    }

    @Override
    public ShopOrderPay get(Long id) {
        return shopOrderPayMapper.get(id);
    }

    @Override
    public ShopOrderPay getByOrderId(Long id) {
        return shopOrderPayMapper.getByOrderId(id);
    }
}
